money = 5000000
name = None
name = input('请输入您的名字：')
def query(active):
    active=True
    if active:
        print('---------------余额查询---------------')
    print(f'{name},您好，您的余额剩余：{money}元')
def saving(sum):
    print('---------------存款---------------')
    global money
    money += sum
    print(f'{name},您好，您存款{sum}元成功')
    query(False)
def get_money(sum):
    global money
    money -= sum
    print('---------------取款---------------')
    print(f'{name},您好，您取款{sum}元成功')
    query(False)
def main():
    print('---------------主菜单---------------')
    print(f'{name},您好，欢迎来到黑马银行ATM，请选择操作；')
    print('查询余额\t [请输入1]')
    print('存款\t\t [请输入2]')
    print('取款\t\t [请输入3]')
    print('退出\t\t [请输入4]')
    return input('你的选择是：')
while True:
    numbers = main()
    if numbers == '1':
        query(True)
        continue
    elif numbers == '2':
        sum = int(input('您要存钱的金额为；'))
        saving(sum)
        continue
    elif numbers == '3':
        sum = int(input('您要取的金额为；'))
        get_money(sum)
        continue
    else:
        print('已退出系统')
        break
